feat: Phase 3 report generation & CLI integration#6
Draft
Conversation
- Add src/measurement-validator/ module with: - types.ts: shared MeasurementResult, MeasurementSeverity, etc. - stats.ts: computeSummary and computeStatsByLanguage helpers - csv-exporter.ts: RFC 4180 CSV with UTF-8 BOM support - markdown-exporter.ts: GitHub Flavored Markdown with language grouping - html-report-generator.ts: self-contained HTML with filter controls - json-exporter.ts: JSON serialization - report-formatter.ts: ReportFormatter class with filter/sort/export - index.ts: public module exports - Add scripts/cli.ts: entry-point CLI (validate/report/help) - Add scripts/validate-command.ts: validate against corpus - Add scripts/report-command.ts: generate report from saved results - Add test/report-generators.test.ts: CSV/Markdown/HTML/JSON tests - Add test/cli.test.ts: CLI validate/report command tests - Add docs/reports.md and docs/cli-reference.md - Add 'validator' script to package.json Agent-Logs-Url: https://github.com/Himaan1998Y/pretext/sessions/471b2265-b3a3-4234-aa20-a154b7a623f5 Co-authored-by: Himaan1998Y <210527591+Himaan1998Y@users.noreply.github.com>
- Clarify exit code 4 as 'File I/O or parsing error' - Mark env vars as reserved/future use (not yet implemented) - Fix comma-separated language filter example (use separate commands) - Fix backslash sanitization in markdown-exporter.ts (CodeQL) Agent-Logs-Url: https://github.com/Himaan1998Y/pretext/sessions/471b2265-b3a3-4234-aa20-a154b7a623f5 Co-authored-by: Himaan1998Y <210527591+Himaan1998Y@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement report generation and CLI enhancements
feat: Phase 3 report generation & CLI integration
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds production-ready multi-format report export and a CLI for running measurement validation — the core deliverable of Phase 3.
New module:
src/measurement-validator/types.tsMeasurementResult,MeasurementSeverity,ReportSummary,LanguageStatsstats.tscomputeSummary(),computeStatsByLanguage()— shared, no circular depscsv-exporter.tsmarkdown-exporter.ts\/|escapinghtml-report-generator.tsjson-exporter.tsreport-formatter.tsReportFormatter— fluent filter/sort/export APICLI (
scripts/)cli.ts— dispatcher forvalidate,report,helpvalidate-command.ts— load corpus → filter → output; exit codes 0/1/2 by severityreport-command.ts— read saved JSON → filter → reformat; exit codes 3/4 on bad args/I/OTests (
test/)report-generators.test.ts— 24 tests: CSV headers/BOM/separators/quoting, Markdown structure/XSS-escaping, HTML validity/filter controls, JSON round-tripcli.test.ts— 13 tests: all output formats, language/severity filters, file output, exit codesDocs (
docs/)reports.md— usage guide + programmatic APIcli-reference.md— full option/exit-code referenceOriginal prompt
Phase 3 (Refined): Report Enhancement & CLI Integration
OBJECTIVE
Implement focused, high-ROI report generation and CLI enhancements. This phase delivers production-ready export formats and user-friendly command-line tools without scope creep.
WHAT WE'RE BUILDING
Scope: 4 Weeks (vs 6 weeks previously)
INCLUDED:
DEFERRED to Phase 4:
REMOVED:
FILES TO CREATE (10 files)
Core Modules (src/measurement-validator/)
1. html-report-generator.ts (2 days)
Features:
2. csv-exporter.ts (1 day)
Format:
3. markdown-exporter.ts (1 day)
Format:
4. json-exporter.ts (0.5 days)
5. report-formatter.ts (Enhanced from Phase 1)
CLI Module (scripts/)
6. cli.ts (1 day)
Options: